-
Notifications
You must be signed in to change notification settings - Fork 1
LPD-68453 Clear filters button doesn't fully clear all filters #5127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
When a filter is active on initial load due to `preloadedData`, clicking the "Clear Filters" button fails to clear the filter from the UI if the user has not interacted with it first. The `deactivateFilter` utility function was directly mutating the filter object, which prevented React from detecting a state change and re-rendering the UI. The function is now updated to return a new, immutable object, ensuring React sees the change and updates the UI correctly.
|
CI is automatically triggering the following test suites:
|
|
Test suite sf has been triggered on http://test-1-31 |
✔️ ci:test:sf - 1 out of 1 jobs passed in 4 minutesRan com.liferay.source.formatter at released version 1.0.1544. Click here for more details.Base Branch:Branch Name: master Sender Branch:Branch Name: LPD-68453_FixFilterClear 1 Successful Jobs:For more details click here. |
|
Jenkins Build:test-portal-source-format#7855 Jenkins Report:jenkins-report.html Jenkins Suite:sf Pull Request:liferay-frontend#5127 Testray Routine:EE Pull Request Testray Build ID: 338879973Testray Importer:test-portal-source-format#7855 |
|
ci:test:frontend-data-set |
|
Test suite frontend-data-set has been triggered on http://test-1-25 |
❌ ci:test:frontend-data-set - 3 out of 6 jobs passed in 56 minutesClick here for more details.Base Branch:Branch Name: master Upstream Comparison:Branch GIT ID: f54453ace69577a7fb5ba5535e9e2ec0f618c787 ci:test:frontend-data-set - 3 out of 6 jobs PASSED3 Failed Jobs:
3 Successful Jobs:For more details click here.Failures unique to this pull:For upstream results, click here.Test bundle downloads: |
|
Jenkins Build:test-portal-acceptance-pullrequest(master)#8592 Jenkins Report:jenkins-report.html Jenkins Suite:frontend-data-set Pull Request:liferay-frontend#5127 Testray Routine:EE Pull Request Testray Build:[master] ci:test:frontend-data-set - thektan > liferay-frontend - PR#5127 - 2025-10-13[20:17:06] Testray Build ID: 338921226Testray Importer:test-portal-acceptance-pullrequest(master)#8592 |
|
Great catch @thektan , my bad. I'd like to review the The other usage is a bit more convoluted, I believe this one would benefit from returning a new object. could you please take a deeper look? Thx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thektan LGTM! ✨
|
@dsanz I'm going to keep Also it looks like For example:
|
In the filter resume dropdown, if you unchecked all the selections and then clicked "Delete Filter", the filter resume label would still show for example: "Color:". This is because `setFilter` needs to be able to also set `active: false` but `activateFilter` was always setting `active: true`
|
ci:test:frontend-data-set |
|
Test suite frontend-data-set has been triggered on http://test-1-34 |
❌ ci:test:frontend-data-set - 3 out of 6 jobs passed in 1 hour 6 minutesClick here for more details.Base Branch:Branch Name: master Upstream Comparison:Branch GIT ID: 6bfad7c5eeca7396b9756980c32197057cc003f2 ci:test:frontend-data-set - 3 out of 6 jobs PASSED3 Failed Jobs:
3 Successful Jobs:For more details click here.Failures unique to this pull:For upstream results, click here.Test bundle downloads: |
|
Jenkins Build:test-portal-acceptance-pullrequest(master)#8485 Jenkins Report:jenkins-report.html Jenkins Suite:frontend-data-set Pull Request:liferay-frontend#5127 Testray Routine:EE Pull Request Testray Build:[master] ci:test:frontend-data-set - thektan > liferay-frontend - PR#5127 - 2025-10-16[13:14:47] Testray Build ID: 341358492Testray Importer:test-portal-acceptance-pullrequest(master)#8485 |
|
Jenkins Build:test-portal-acceptance-pullrequest(master)#8493 Jenkins Report:jenkins-report.html Jenkins Suite:frontend-data-set Pull Request:liferay-frontend#5127 Testray Routine:EE Pull Request Testray Build:[master] ci:test:frontend-data-set - thektan > liferay-frontend - PR#5127 - 2025-10-16[15:58:08] Testray Build ID: 341435753Testray Importer:test-portal-acceptance-pullrequest(master)#8493 |
|
ci:test:sf |
|
ci:test:relevant |
|
Test suite sf has been triggered on http://test-1-37 |
|
Test suite relevant has been triggered on http://test-1-37 |
✔️ ci:test:sf - 1 out of 1 jobs passed in 4 minutesRan com.liferay.source.formatter at released version 1.0.1545. Click here for more details.Base Branch:Branch Name: master Sender Branch:Branch Name: LPD-68453_FixFilterClear 1 Successful Jobs:For more details click here. |
|
Jenkins Build:test-portal-source-format#13983 Jenkins Report:jenkins-report.html Jenkins Suite:sf Pull Request:liferay-frontend#5127 Testray Routine:EE Pull Request Testray Build ID: 342071436Testray Importer:test-portal-source-format#13983 |
✔️ ci:test:stable - 11 out of 11 jobs passed❌ ci:test:relevant - 14 out of 16 jobs passed in 1 hour 3 minutesClick here for more details.Base Branch:Branch Name: master Upstream Comparison:Branch GIT ID: 2018e7596b60007f382316cc000ce88d1994c6fa ci:test:stable - 11 out of 11 jobs PASSED11 Successful Jobs:ci:test:relevant - 14 out of 16 jobs PASSED2 Failed Jobs:
14 Successful Jobs:For more details click here.Failures unique to this pull:For upstream results, click here.Test bundle downloads: |
|
Jenkins Build:test-portal-acceptance-pullrequest(master)#24391 Jenkins Report:jenkins-report.html Jenkins Suite:relevant Pull Request:liferay-frontend#5127 Testray Routine:EE Pull Request Testray Build:[master] ci:test:relevant - thektan > liferay-frontend - PR#5127 - 2025-10-17[12:18:08] Testray Build ID: 342081986Testray Importer:test-portal-acceptance-pullrequest(master)#24391 |
|
@dsanz @markocikos As a heads up I changed the solution to only return a new object since the config in URL navigation would break (when clearing the filters, navigating back and forward if the filter wasn't mutated 🙃. Looks like this allows everything to work as expected now: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
|
ci:forward:force |
|
CI is automatically triggering the following test suites:
The pull request will automatically be forwarded to the user
|
|
Skipping previously completed test suites:
|
|
Test suite default has been triggered on http://test-1-26 |
|
All required test suite(s) completed. |
|
Pull request has been successfully forwarded to brianchandotcom#166833 |

Bug Ticket: https://liferay.atlassian.net/browse/LPD-68453
This fixes the clear filter buttons (in the active filters bar/empty state) to clear the pre-loaded filter. This was previously mutating the object so the component wasn't re-rendering so now it returns a new object. This was also how the logic worked before.
Previously the dispatch looked like: